<?php
namespace app\common\validate;

use think\Validate;

class JobValidate extends Validate
{
    protected $rule =   [
        'total|服务费'          => 'require',
        'name|职位名称'         => 'require|length:1,200',
        'need_num|需求人数'     => 'require|number',
        'demand|招聘要求'       => 'require',
        'warranty|保证期'       => 'require',
        'warranty2|保证期2'     => 'require',
        'education|学历'        => 'require',
        'exp_low|工作经验'      => 'require',
        'exp_high|工作经验'     => 'require',
        'address|地址'          => 'require',
        'recruit_type|招聘类型' => 'require',
        'salary_low|薪资'       => 'require|number',
        'salary_high|薪资'      => 'require|number',
    ];
    
    protected $scene = [
        /** api */
        'add'    => ['name', 'total', 'need_num', 'demand', 'warranty', 'warranty2', 'education', 'exp_low', 'exp_high', 'address', 'recruit_type', 'salary_low', 'salary_high'],
        'edit'   => ['id', 'name', 'total', 'need_num', 'demand', 'warranty', 'warranty2', 'education', 'exp_low', 'exp_high', 'address', 'recruit_type', 'salary_low', 'salary_high'],
    ];
}